Integrand size = 28, antiderivative size = 643 \[ \int \frac {(e+f x)^3 \sin ^2(c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {a (e+f x)^4}{4 b^2 f}+\frac {6 f^2 (e+f x) \cos (c+d x)}{b d^3}-\frac {(e+f x)^3 \cos (c+d x)}{b d}-\frac {i a^2 (e+f x)^3 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d}+\frac {i a^2 (e+f x)^3 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d}-\frac {3 a^2 f (e+f x)^2 \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^2}+\frac {3 a^2 f (e+f x)^2 \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^2}-\frac {6 i a^2 f^2 (e+f x) \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^3}+\frac {6 i a^2 f^2 (e+f x) \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^3}+\frac {6 a^2 f^3 \operatorname {PolyLog}\left (4,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^4}-\frac {6 a^2 f^3 \operatorname {PolyLog}\left (4,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^4}-\frac {6 f^3 \sin (c+d x)}{b d^4}+\frac {3 f (e+f x)^2 \sin (c+d x)}{b d^2} \]
[Out]
Time = 0.79 (sec) , antiderivative size = 643, normalized size of antiderivative = 1.00, number of steps used = 19, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.393, Rules used = {4611, 3377, 2717, 32, 3404, 2296, 2221, 2611, 6744, 2320, 6724} \[ \int \frac {(e+f x)^3 \sin ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\frac {6 a^2 f^3 \operatorname {PolyLog}\left (4,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 d^4 \sqrt {a^2-b^2}}-\frac {6 a^2 f^3 \operatorname {PolyLog}\left (4,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 d^4 \sqrt {a^2-b^2}}-\frac {6 i a^2 f^2 (e+f x) \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 d^3 \sqrt {a^2-b^2}}+\frac {6 i a^2 f^2 (e+f x) \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 d^3 \sqrt {a^2-b^2}}-\frac {3 a^2 f (e+f x)^2 \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 d^2 \sqrt {a^2-b^2}}+\frac {3 a^2 f (e+f x)^2 \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 d^2 \sqrt {a^2-b^2}}-\frac {i a^2 (e+f x)^3 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 d \sqrt {a^2-b^2}}+\frac {i a^2 (e+f x)^3 \log \left (1-\frac {i b e^{i (c+d x)}}{\sqrt {a^2-b^2}+a}\right )}{b^2 d \sqrt {a^2-b^2}}-\frac {a (e+f x)^4}{4 b^2 f}-\frac {6 f^3 \sin (c+d x)}{b d^4}+\frac {6 f^2 (e+f x) \cos (c+d x)}{b d^3}+\frac {3 f (e+f x)^2 \sin (c+d x)}{b d^2}-\frac {(e+f x)^3 \cos (c+d x)}{b d} \]
[In]
[Out]
Rule 32
Rule 2221
Rule 2296
Rule 2320
Rule 2611
Rule 2717
Rule 3377
Rule 3404
Rule 4611
Rule 6724
Rule 6744
Rubi steps \begin{align*} \text {integral}& = \frac {\int (e+f x)^3 \sin (c+d x) \, dx}{b}-\frac {a \int \frac {(e+f x)^3 \sin (c+d x)}{a+b \sin (c+d x)} \, dx}{b} \\ & = -\frac {(e+f x)^3 \cos (c+d x)}{b d}-\frac {a \int (e+f x)^3 \, dx}{b^2}+\frac {a^2 \int \frac {(e+f x)^3}{a+b \sin (c+d x)} \, dx}{b^2}+\frac {(3 f) \int (e+f x)^2 \cos (c+d x) \, dx}{b d} \\ & = -\frac {a (e+f x)^4}{4 b^2 f}-\frac {(e+f x)^3 \cos (c+d x)}{b d}+\frac {3 f (e+f x)^2 \sin (c+d x)}{b d^2}+\frac {\left (2 a^2\right ) \int \frac {e^{i (c+d x)} (e+f x)^3}{i b+2 a e^{i (c+d x)}-i b e^{2 i (c+d x)}} \, dx}{b^2}-\frac {\left (6 f^2\right ) \int (e+f x) \sin (c+d x) \, dx}{b d^2} \\ & = -\frac {a (e+f x)^4}{4 b^2 f}+\frac {6 f^2 (e+f x) \cos (c+d x)}{b d^3}-\frac {(e+f x)^3 \cos (c+d x)}{b d}+\frac {3 f (e+f x)^2 \sin (c+d x)}{b d^2}-\frac {\left (2 i a^2\right ) \int \frac {e^{i (c+d x)} (e+f x)^3}{2 a-2 \sqrt {a^2-b^2}-2 i b e^{i (c+d x)}} \, dx}{b \sqrt {a^2-b^2}}+\frac {\left (2 i a^2\right ) \int \frac {e^{i (c+d x)} (e+f x)^3}{2 a+2 \sqrt {a^2-b^2}-2 i b e^{i (c+d x)}} \, dx}{b \sqrt {a^2-b^2}}-\frac {\left (6 f^3\right ) \int \cos (c+d x) \, dx}{b d^3} \\ & = -\frac {a (e+f x)^4}{4 b^2 f}+\frac {6 f^2 (e+f x) \cos (c+d x)}{b d^3}-\frac {(e+f x)^3 \cos (c+d x)}{b d}-\frac {i a^2 (e+f x)^3 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d}+\frac {i a^2 (e+f x)^3 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d}-\frac {6 f^3 \sin (c+d x)}{b d^4}+\frac {3 f (e+f x)^2 \sin (c+d x)}{b d^2}+\frac {\left (3 i a^2 f\right ) \int (e+f x)^2 \log \left (1-\frac {2 i b e^{i (c+d x)}}{2 a-2 \sqrt {a^2-b^2}}\right ) \, dx}{b^2 \sqrt {a^2-b^2} d}-\frac {\left (3 i a^2 f\right ) \int (e+f x)^2 \log \left (1-\frac {2 i b e^{i (c+d x)}}{2 a+2 \sqrt {a^2-b^2}}\right ) \, dx}{b^2 \sqrt {a^2-b^2} d} \\ & = -\frac {a (e+f x)^4}{4 b^2 f}+\frac {6 f^2 (e+f x) \cos (c+d x)}{b d^3}-\frac {(e+f x)^3 \cos (c+d x)}{b d}-\frac {i a^2 (e+f x)^3 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d}+\frac {i a^2 (e+f x)^3 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d}-\frac {3 a^2 f (e+f x)^2 \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^2}+\frac {3 a^2 f (e+f x)^2 \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^2}-\frac {6 f^3 \sin (c+d x)}{b d^4}+\frac {3 f (e+f x)^2 \sin (c+d x)}{b d^2}+\frac {\left (6 a^2 f^2\right ) \int (e+f x) \operatorname {PolyLog}\left (2,\frac {2 i b e^{i (c+d x)}}{2 a-2 \sqrt {a^2-b^2}}\right ) \, dx}{b^2 \sqrt {a^2-b^2} d^2}-\frac {\left (6 a^2 f^2\right ) \int (e+f x) \operatorname {PolyLog}\left (2,\frac {2 i b e^{i (c+d x)}}{2 a+2 \sqrt {a^2-b^2}}\right ) \, dx}{b^2 \sqrt {a^2-b^2} d^2} \\ & = -\frac {a (e+f x)^4}{4 b^2 f}+\frac {6 f^2 (e+f x) \cos (c+d x)}{b d^3}-\frac {(e+f x)^3 \cos (c+d x)}{b d}-\frac {i a^2 (e+f x)^3 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d}+\frac {i a^2 (e+f x)^3 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d}-\frac {3 a^2 f (e+f x)^2 \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^2}+\frac {3 a^2 f (e+f x)^2 \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^2}-\frac {6 i a^2 f^2 (e+f x) \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^3}+\frac {6 i a^2 f^2 (e+f x) \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^3}-\frac {6 f^3 \sin (c+d x)}{b d^4}+\frac {3 f (e+f x)^2 \sin (c+d x)}{b d^2}+\frac {\left (6 i a^2 f^3\right ) \int \operatorname {PolyLog}\left (3,\frac {2 i b e^{i (c+d x)}}{2 a-2 \sqrt {a^2-b^2}}\right ) \, dx}{b^2 \sqrt {a^2-b^2} d^3}-\frac {\left (6 i a^2 f^3\right ) \int \operatorname {PolyLog}\left (3,\frac {2 i b e^{i (c+d x)}}{2 a+2 \sqrt {a^2-b^2}}\right ) \, dx}{b^2 \sqrt {a^2-b^2} d^3} \\ & = -\frac {a (e+f x)^4}{4 b^2 f}+\frac {6 f^2 (e+f x) \cos (c+d x)}{b d^3}-\frac {(e+f x)^3 \cos (c+d x)}{b d}-\frac {i a^2 (e+f x)^3 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d}+\frac {i a^2 (e+f x)^3 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d}-\frac {3 a^2 f (e+f x)^2 \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^2}+\frac {3 a^2 f (e+f x)^2 \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^2}-\frac {6 i a^2 f^2 (e+f x) \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^3}+\frac {6 i a^2 f^2 (e+f x) \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^3}-\frac {6 f^3 \sin (c+d x)}{b d^4}+\frac {3 f (e+f x)^2 \sin (c+d x)}{b d^2}+\frac {\left (6 a^2 f^3\right ) \text {Subst}\left (\int \frac {\operatorname {PolyLog}\left (3,\frac {i b x}{a-\sqrt {a^2-b^2}}\right )}{x} \, dx,x,e^{i (c+d x)}\right )}{b^2 \sqrt {a^2-b^2} d^4}-\frac {\left (6 a^2 f^3\right ) \text {Subst}\left (\int \frac {\operatorname {PolyLog}\left (3,\frac {i b x}{a+\sqrt {a^2-b^2}}\right )}{x} \, dx,x,e^{i (c+d x)}\right )}{b^2 \sqrt {a^2-b^2} d^4} \\ & = -\frac {a (e+f x)^4}{4 b^2 f}+\frac {6 f^2 (e+f x) \cos (c+d x)}{b d^3}-\frac {(e+f x)^3 \cos (c+d x)}{b d}-\frac {i a^2 (e+f x)^3 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d}+\frac {i a^2 (e+f x)^3 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d}-\frac {3 a^2 f (e+f x)^2 \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^2}+\frac {3 a^2 f (e+f x)^2 \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^2}-\frac {6 i a^2 f^2 (e+f x) \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^3}+\frac {6 i a^2 f^2 (e+f x) \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^3}+\frac {6 a^2 f^3 \operatorname {PolyLog}\left (4,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^4}-\frac {6 a^2 f^3 \operatorname {PolyLog}\left (4,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2} d^4}-\frac {6 f^3 \sin (c+d x)}{b d^4}+\frac {3 f (e+f x)^2 \sin (c+d x)}{b d^2} \\ \end{align*}
Time = 5.95 (sec) , antiderivative size = 1020, normalized size of antiderivative = 1.59 \[ \int \frac {(e+f x)^3 \sin ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\frac {-a d^4 x \left (4 e^3+6 e^2 f x+4 e f^2 x^2+f^3 x^3\right )-4 b d (e+f x) \left (-6 f^2+d^2 (e+f x)^2\right ) \cos (c+d x)+\frac {4 a^2 \left (2 \sqrt {-a^2+b^2} d^3 e^3 \arctan \left (\frac {i a+b e^{i (c+d x)}}{\sqrt {a^2-b^2}}\right )+3 \sqrt {a^2-b^2} d^3 e^2 f x \log \left (1-\frac {b e^{i (c+d x)}}{-i a+\sqrt {-a^2+b^2}}\right )+3 \sqrt {a^2-b^2} d^3 e f^2 x^2 \log \left (1-\frac {b e^{i (c+d x)}}{-i a+\sqrt {-a^2+b^2}}\right )+\sqrt {a^2-b^2} d^3 f^3 x^3 \log \left (1-\frac {b e^{i (c+d x)}}{-i a+\sqrt {-a^2+b^2}}\right )-3 \sqrt {a^2-b^2} d^3 e^2 f x \log \left (1+\frac {b e^{i (c+d x)}}{i a+\sqrt {-a^2+b^2}}\right )-3 \sqrt {a^2-b^2} d^3 e f^2 x^2 \log \left (1+\frac {b e^{i (c+d x)}}{i a+\sqrt {-a^2+b^2}}\right )-\sqrt {a^2-b^2} d^3 f^3 x^3 \log \left (1+\frac {b e^{i (c+d x)}}{i a+\sqrt {-a^2+b^2}}\right )-3 i \sqrt {a^2-b^2} d^2 f (e+f x)^2 \operatorname {PolyLog}\left (2,\frac {b e^{i (c+d x)}}{-i a+\sqrt {-a^2+b^2}}\right )+3 i \sqrt {a^2-b^2} d^2 f (e+f x)^2 \operatorname {PolyLog}\left (2,-\frac {b e^{i (c+d x)}}{i a+\sqrt {-a^2+b^2}}\right )+6 \sqrt {a^2-b^2} d e f^2 \operatorname {PolyLog}\left (3,\frac {b e^{i (c+d x)}}{-i a+\sqrt {-a^2+b^2}}\right )+6 \sqrt {a^2-b^2} d f^3 x \operatorname {PolyLog}\left (3,\frac {b e^{i (c+d x)}}{-i a+\sqrt {-a^2+b^2}}\right )-6 \sqrt {a^2-b^2} d e f^2 \operatorname {PolyLog}\left (3,-\frac {b e^{i (c+d x)}}{i a+\sqrt {-a^2+b^2}}\right )-6 \sqrt {a^2-b^2} d f^3 x \operatorname {PolyLog}\left (3,-\frac {b e^{i (c+d x)}}{i a+\sqrt {-a^2+b^2}}\right )+6 i \sqrt {a^2-b^2} f^3 \operatorname {PolyLog}\left (4,\frac {b e^{i (c+d x)}}{-i a+\sqrt {-a^2+b^2}}\right )-6 i \sqrt {a^2-b^2} f^3 \operatorname {PolyLog}\left (4,-\frac {b e^{i (c+d x)}}{i a+\sqrt {-a^2+b^2}}\right )\right )}{\sqrt {-\left (a^2-b^2\right )^2}}+12 b f \left (-2 f^2+d^2 (e+f x)^2\right ) \sin (c+d x)}{4 b^2 d^4} \]
[In]
[Out]
\[\int \frac {\left (f x +e \right )^{3} \left (\sin ^{2}\left (d x +c \right )\right )}{a +b \sin \left (d x +c \right )}d x\]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 2671 vs. \(2 (567) = 1134\).
Time = 0.53 (sec) , antiderivative size = 2671, normalized size of antiderivative = 4.15 \[ \int \frac {(e+f x)^3 \sin ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\text {Too large to display} \]
[In]
[Out]
Timed out. \[ \int \frac {(e+f x)^3 \sin ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\text {Timed out} \]
[In]
[Out]
Exception generated. \[ \int \frac {(e+f x)^3 \sin ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
\[ \int \frac {(e+f x)^3 \sin ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\int { \frac {{\left (f x + e\right )}^{3} \sin \left (d x + c\right )^{2}}{b \sin \left (d x + c\right ) + a} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {(e+f x)^3 \sin ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\text {Hanged} \]
[In]
[Out]